package com.usabb.domain;

import java.math.BigDecimal;
import java.util.List;
import java.util.Objects;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.ifast.common.base.BaseDO;

import com.usabb.api.dto.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 
 * <pre>
 * 月子中心基础表
 * </pre>
 * <small> 2019-08-19 18:03:27 | Aron</small>
 */
@Data
@SuppressWarnings("serial")
@TableName("maternity_base")
@EqualsAndHashCode(callSuper=true) 
public class MaternityBaseDO extends BaseDO {
	@TableId
	private Long id;

    /** 标题 */
    private String name;

    /** 介绍 */
    private String intro;

    /** 描述 */
    private String description;

    /** 地址 */
    private String address;

    /** 联系人 */
    @TableField(value = "contact_name")
    private String contactName;

    /** 联系人手机号 */
    @TableField(value = "contact_mobile_no")
    private String contactMobileNo;

    /** 联系人wechat */
    @TableField(value = "contact_wechat")
    private String contactWechat;

    /** 联系人邮箱 */
    @TableField(value = "contact_email")
    private String contactEmail;

    /** 标签内容,英文逗号分隔 */
    private String labels;

    /** 所在城市 */
    @TableField(value = "city_in")
    private Integer cityIn;


    @TableField(value = "amount_from")
    private BigDecimal amountFrom;
    @TableField(value = "amount_to")
    private BigDecimal amountTo;

    /** 套餐数 */
    @TableField(value = "combos_count")
    private Integer combosCount;

    /** 联系订单数 */
    @TableField(value = "order_count")
    private Integer orderCount;

    /** 实地验证标志, 0未,1已 */
    @TableField(value = "verify_flag")
    private Boolean verifyFlag;

    /** 上架标志, 0未,1上架中 */
    @TableField(value = "online_flag")
    private Boolean onlineFlag;




    public void plusCombosCount() {
        if (Objects.isNull(combosCount)) {
            combosCount = 0;
        }

        this.combosCount += 1;
    }



    // 非表字段 用于接口显示
    @TableField(exist = false)
    private List<RoundTypeDTO> roundTypes;
    @TableField(exist = false)
    private List<HospitalDTO> hospitals;
    @TableField(exist = false)
    private List<GuestCaseDTO> guestCases;
    @TableField(exist = false)
    private AttachesDTO attaches;
    @TableField(exist = false)
    private AmenitiesDTO amenities;

}
